package com.youmu.sichuansfc.domain;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "youmu_area", schema = "youmu", catalog = "")
public class YoumuArea {
    private Long id;
    private Date addTime;
    private Boolean deleteStatus;
    private String areaName;
    private Integer level;
    private Integer sequence;
    private Long parentId;
    private Boolean common;

    public void setId(long id) {
        this.id = id;
    }


    public void setDeleteStatus(boolean deleteStatus) {
        this.deleteStatus = deleteStatus;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public void setSequence(int sequence) {
        this.sequence = sequence;
    }

    @Id
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "add_time")
    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "delete_status")
    public Boolean getDeleteStatus() {
        return deleteStatus;
    }


    @Basic
    @Column(name = "area_name")
    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    @Basic
    @Column(name = "level")
    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    @Basic
    @Column(name = "sequence")
    public Integer getSequence() {
        return sequence;
    }

    public void setSequence(Integer sequence) {
        this.sequence = sequence;
    }

    @Basic
    @Column(name = "parent_id")
    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    @Basic
    @Column(name = "common")
    public Boolean getCommon() {
        return common;
    }

    public void setCommon(Boolean common) {
        this.common = common;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        YoumuArea youmuArea = (YoumuArea) o;
        return id == youmuArea.id &&
                deleteStatus == youmuArea.deleteStatus &&
                level == youmuArea.level &&
                sequence == youmuArea.sequence &&
                Objects.equals(addTime, youmuArea.addTime) &&
                Objects.equals(areaName, youmuArea.areaName) &&
                Objects.equals(parentId, youmuArea.parentId) &&
                Objects.equals(common, youmuArea.common);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, addTime, deleteStatus, areaName, level, sequence, parentId, common);
    }
}
